﻿using System;
using System.Collections.Generic;
using System.Text;

namespace HeadFirest._08.IteratorAndComponet._01.Menus
{
    public class MenuItem : Menucomponent
    {

        private readonly string _name;
        public string _description;
        bool _vegetarian;
        double _price;

        public MenuItem(string name, string description, bool vegetarian, double price)
        {
            _name = name ?? throw new ArgumentNullException(nameof(name));
            _description = description ?? throw new ArgumentNullException(nameof(description));
            _vegetarian = vegetarian;
            _price = price;
        }

        public override string GetDescription()
        {
            return _description;
        }

        public override string GetName()
        {
            return _name;
        }

        public override double GetPrice()
        {
            return _price;
        }

        public override bool IsVegetarian()
        {
            return _vegetarian;
        }

        public override void Print()
        {
            Console.WriteLine(" " + GetName());
            if (IsVegetarian())
            {
                Console.WriteLine("(v)");
            }
            Console.WriteLine(", " + GetPrice());
            Console.WriteLine("    --" + GetDescription());
        }
    }
}
